package com.am.mosl.cityandroid.leftmenu;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.am.mosl.cityandroid.mainboard.ActivityDetailActivity;
import com.am.mosl.cityandroid.R;
import com.am.mosl.cityandroid.activity.BaseActivity;

public class MessageDetailActivity extends BaseActivity {

	private TextView mes_title;
	private TextView mes_time;
	private TextView mes_content;
	private View m_button_content;
	private Button mes_button;
	
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.message_detail);

		mes_title = (TextView) findViewById(R.id.mes_title);
		mes_time = (TextView) findViewById(R.id.mes_time);
		mes_content = (TextView) findViewById(R.id.mes_content);
		m_button_content = (View) findViewById(R.id.m_button_content);
		mes_button = (Button) findViewById(R.id.mes_button);
		
		Bundle extras = getIntent().getExtras();
		String title = extras.getString("title");
		String time = extras.getString("time");
		String des = extras.getString("des");
		final String content_id = extras.getString("content_id");
		
		mes_title.setText(title);
		mes_time.setText(time);
		mes_content.setText(des);
		
		if(content_id.equals("0")){
			m_button_content.setVisibility(View.GONE);
		}
		else{
			mes_button.setOnClickListener(new OnClickListener() {
				
				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					Intent i = new Intent(MessageDetailActivity.this,
							ActivityDetailActivity.class);
					i.putExtra("Intent_To_ArticleDetail", content_id);									
					startActivity(i);
					
				}
			});
		}
		
	}
	
	// 点击返回
	public void BacktoBack(View view) {
		this.finish();
	}
		
}
